Repository navigation
Leave the built-in off the bar when a second clone of it is disabled - #17563
Closed
ThePrimeagen wants to merge 1 commit into
Closed
ThePrimeagen wants to merge 1 commit into
ThePrimeagen wants to merge 1 commit into
Conversation
Contributor
[Medium impact] The PR appears safe to merge; both previously reported problems are fixed. SummaryDisabling a clone now leaves the built-in off the bar while another clone still occupies it.
Both previous findings are fixed. No new actionable issues were found.
|
Co-authored-by: Cursor <cursoragent@cursor.com>
ThePrimeagen
force-pushed
the
fix/clock-clone-disable
branch
from
November 4, 2026 16:18
9934fca to
578ade6
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
With two clones of the same built-in on the bar, such as your own from
omarchy-plugin-clone omarchy.clockand one someone shared that you added withomarchy-plugin-add, disabling either one brings the built-in back beside the clone that stays: two clocks on the bar, or, foromarchy.menu, two menu buttons.restoreCloneSource, which turns the clone's bar entry back into the built-in it was cloned from. Nothing checks whether another clone of that built-in is still on the bar standing in for it.setEnablednow restores the built-in only when no other clone of it has a widget on the bar (barCloneFor). Otherwise it drops every record of the disabled clone, its bar entry and anyplugins[]record, so it stops receiving the built-in's calls; and when the disabled clone was the one that switched a menu or panel built-in off (cloneSourceRestores), it hands that over to the clone that stays, so the built-in is switched back on when the last clone goes.plugins[], with its widget taken off the bar, does not count as standing in, so disabling the last clone on the bar still puts the built-in back in place.omarchy-plugin-removedisables an enabled clone with the samesetPluginEnabled <id> falsecall, so removing a clone goes through this path too (from the code; only disabling was run in the VM).Steps
omarchy-plugin-clone omarchy.menu. Your copy,<user>.menu, replacesomarchy.menuin place on the bar, andomarchy.menuis switched off (disabledPlugins). One menu button.omarchy.menuis no longer on the bar to replace, soalice.menugoes intocenterEnd. Two menu buttons, as expected.omarchy-plugin-disable <user>.menu.quattro:<user>.menu's entry is turned intoomarchy.menu, so the bar still shows two menu buttons.alice.menuis still on the bar, so<user>.menuis just taken off. One menu button.omarchy-plugin-disable alice.menu.omarchy.menucomes back in its place, switched on, and Super+Space opens it.The same steps with
omarchy.clockleave two clocks at step 3 onquattro, one with this change.Verification
test/shell.d/plugin-registry-contract-test.shgets one check, with two clones of a bar widget and two of a menu-and-widget built-in. Disabling the second widget clone leaves the first in the source's place with nothing beside it, and the last clone on the bar restores the source. Disabling the first menu clone while the second is on the bar (with the first also inplugins[]) takes it off the bar and out ofplugins[], so calls to the built-in go to the second; disabling the second then brings the built-in back and switches it on.quattro1d880868bit fails with the built-in beside the remaining clone:actual=[[{"id":"local.first-widget","size":4}],[{"id":"omarchy.first-widget"}],...,{"left":[{"id":"omarchy.hybrid"}],...}.plugins[]and still receiving the built-in's calls, and the built-in left switched off:{"left":[],"centerEnd":[{"id":"shared.hybrid"}],"plugins":[{"id":"local.hybrid"}],"receiver":"local.hybrid"},[{"id":"omarchy.hybrid"}],false].plugin-registry-contract,plugin-clone,plugin-enable,plugin-manifest-scan,plugins,plugin-watcher-reap,runtime-smokeandmanifest-entrypointsundertest/shell.d/pass, none skipped.qmllintreports nothing forPluginRegistry.qml, before or after.quattro1d880868b, then the same test run on an ISO built from1d880868bplus this change: clone the clock, add a shared copy, disable the shared copy; clone the menu, add a shared copy, disable your copy, disable the shared copy, press Super+Space. After each command the test prints the widgets actually drawn on the bar (omarchy-shell shell debugBarGeometry) anddisabledPlugins/cloneSourceRestoresfromshell.json.quattro: two clocks drawn after disabling the shared clock (["prime.clock","omarchy.clock"]), and two menus drawn after disabling your menu (["alice.menu","omarchy.menu"]).["prime.clock"]), one menu (["alice.menu"], withcloneSourceRestoresnow["alice.menu"]), then["omarchy.menu"]withdisabledPluginsnull, and Super+Space opens the Omarchy menu.[]),omarchy.menuis still indisabledPlugins, and Super+Space opens nothing.restoreCloneSource's cleanup (every bar andplugins[]record, and itscloneSourceRestoresentry). Searched every caller ofrestoreCloneSource, every writer ofcloneSourceRestores,disabledPlugins,plugins[]andbar.layoutundershell/, and everybin/omarchy-plugin-*. Fixed here: the disable path ofsetEnabledfor clones on the bar. Not affected: bar-kind clones (recorded only asbar.id) andomarchy-plugin-disable(goes throughsetEnabled). Left for Some ways a clone leaves skip its cleanup: its built-in stays switched off, or comes back beside another clone #17577, all onquattrotoday: two clones of an overlay, panel or service built-in (they live inplugins[], whichbarCloneFordoes not count), dragging a menu clone off the bar,omarchy bar defaults,omarchy plugin removeof a widget clone that is off the bar, and a clone deleted by hand.omarchy-plugin-enable omarchy.clock) restores it in place of one clone and leaves the other beside it. That path picks a single clone (activeCloneFor), a different cause that needs its own fix.plugins[]record is covered by the test check only; the VM steps do not produce one.Screenshots